var config = require ('../../config');
var {logUtils, randomUtils} = require ('../utils/index');
var daiShuDianDian = require ('../apps/daiShuDianDian/index');
var xiGua = require ('../apps/xiGua/index');
var hongGuo = require ('../apps/hongGuo/index');
var apps = [
  //prettier-ignore
  daiShuDianDian,
  xiGua,
  hongGuo,
];
function start () {
  while (true) {
    for (var index = 0; index < apps.length; index++) {
      var app = apps[index];
      var isIgnoreApp = config.ignoreApps.find (ignoreApp => {
        return ignoreApp == app.name;
      });
      if (isIgnoreApp) {
        console.log (`${app.name} is ignore`);
        logUtils.log (app.name + '被跳过');
      } else {
        app.main ();
      }
      sleep (randomUtils.getRandom (2, 3, 1000));
    }
  }
}

start ();
